<?php
namespace Littlexiaoshuishui\Upay\Tests;

use Littlexiaoshuishui\Upay\Pay;
class PayTest extends TestCase
{
    public $config=[
        'merchantId'=>"ME20191122172000001",
        'appid'=>"10000454",
        'publicKeyPath'=>"aa",
        'privateKeyPath'=>"aa",
        'qfpayRemoteUrl'=>"https://www.baidu.com",
        'notifyUrl'=>"https://www.baidu.com/",
        'callBackUrl'=>"",
        'country'=>"IN",
        'currency'=>"INR",
        'language'=>"en_US",
        'apiVersion'=>"1.0",
    ];
    public function testPay()
    {
        $order = [
            "channelCode"=>"PDACIDJ1-WITHDRAW-B2C-D-S",
            "channelType"=>"aa",
            "payerName"=>"gengchaonan",
            "payerPhone"=>"18711111111",
            "payerEmail"=>"test@163.com",
            "orderNo"=>"159831772779655555",
            "amount"=>"2",
        ];
        $qfpay = Pay::qfpay($this->config);
        $res = $qfpay->pay($order);
        var_dump($res);
    }
    public function testWithdrawWallet()
    {
        $order = [
            "payeeAccount"=>"123456",
            "orderNo"=>"159831772779655555",
            "amount"=>"2",
        ];
        $qfpay = Pay::qfpay($this->config);
        $res = $qfpay->withdraw($order,'wallet');
        var_dump($res);
    }
    public function testWithdrawBank()
    {
        $order = [
            "payeeAccount"=>"123456",
            "orderNo"=>"159831772779655555",
            "amount"=>"2",
            "payerName"=>"gengchaonan",
            "payeeMoblie"=>"18711111111",
            "payerEmail"=>"test@163.com",
            'bankCode'=>"123",
            'bankLinkNo'=>"888",
            'bankName'=>"95652",
            'bankBranchName'=>"gfdd",
            'bankCardNo'=>"123",
            'cardType'=>"1",
        ];
        $qfpay = Pay::qfpay($this->config);
        $res = $qfpay->withdraw($order,'bank');
        var_dump($res);
    }

}